<%-- 
    Document   : bookPage
    Created on : Jul 5, 2013, 11:45:02 PM
    Author     : TharoHuynh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Book | Lafitte</title>
        <link rel="shortcut icon" href="./images2/logo.jpg">

        <script src="datetimepicker_css.js" type="text/javascript"></script>
        <style type="text/css">
            body{
                background-image: url('images2/Untitled.jpg');
                background-repeat: no-repeat;
                background-color: black;
            }
            .container[role="main"] {
                padding-bottom: 60px;
            }
            .bottombar {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
            }
        </style>
    </head>
    <body>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span4"></div>
                <div class="span6">
                    <jsp:include page="menubar.jsp"/><br/>

                    <h1 style="color: white"><font face="Algerian">BOOK</font></h1>
                    <!--regular card-->
                    <c:if test="${RANK eq 0}">
                        <font color="red">Sorry but you don't have right to book any room.</font>
                    </c:if>

                    <!--silver or gold-->
                    <c:if test="${RANK ne 0}">
                        <!--card da bi block-->
                        <c:if test="${ISBLOCK}">
                            <font color="red">Sorry but you don't have right to book any room.<br/>Your card was blocked.</font>
                            </c:if>

                        <!--card chua bi block-->
                        <c:if test="${not ISBLOCK}">
                            <form action="Controller" method="POST">
                                <table border="0">
                                    <tr>
                                        <td style="color: white">Please choose a day:<span style="color: red">*</span></td>
                                        <td style="color: white"><input type="text" name="txtDate" value="${param.txtDate}" id="demo1" readonly="readonly"/>
                                            <img alt="" src="images2/cal.gif" onclick="javascript:NewCssCal('demo1')" style="cursor:pointer"/>
                                            <input type="hidden" name="txtUsername" value="${USER}" />
                                            <input type="submit" value="Choose" name="btAction" class="btn btn-inverse"/>
                                        </td>
                                    </tr>
                                </table>

                                <!--invalid date-->
                                <c:if test="${not empty MESS}">
                                    <font color="red">${MESS}</font>
                                </c:if>

                                <!--valid date-->
                                <c:if test="${empty MESS}">
                                    <c:if test="${not empty param.txtDate}">
                                        <!-- book phong roi-->
                                        <c:if test="${not empty BOOKROOM}">
                                            <c:forEach items="${BOOKROOM}" var="br">
                                                <p style="color: white">You booked ${br.room.roomId} - ${br.room.roomName} on that day.
                                                    <br/>You want to cancel booking?</p>

                                                <input type="hidden" name="txtBookRoom" value="${br.room.roomId}" />
                                                <input type="hidden" name="txtUser" value="${USER}" />
                                                <br/><input type="submit" value="Yes, please cancel." name="btAction" class="btn btn-inverse" />
                                            </c:forEach>
                                        </c:if>

                                        <!--chua book phong-->
                                        <c:if test="${empty MESSAGE2}">
                                            <c:if test="${empty BOOKROOM}">
                                                <h2 style="color: white"><font face="Algerian">Room</font></h2>

                                                <!--het phong-->
                                                <c:if test="${RANK eq 1}">
                                                    <c:if test="${empty ROOMLIST}">
                                                        <p style="color: white">Sorry, no empty room in that day. Please choose another day. Thanks.</p>
                                                    </c:if>
                                                </c:if>

                                                <c:if test="${RANK eq 2}">
                                                    <c:if test="${empty ROOMLIST}">
                                                        <c:if test="${empty GOLDLIST}">
                                                            <p style="color: white">Sorry, no empty room in that day. Please choose another day. Thanks.</p>
                                                        </c:if>
                                                    </c:if>
                                                </c:if>

                                                <!--con phong-->
                                                <table border="0">
                                                    <!--silver room-->
                                                    <c:if test="${not empty ROOMLIST}">
                                                        <tr>
                                                            <c:forEach var="room" items="${ROOMLIST}">
                                                                <td style="color: white">${book.room.roomId}<input type="radio" name="rdo" value="${room.roomId}" /></td>
                                                                <td style="color: white">${room.roomName}<br/>${room.description}<br/>Price: ${room.price}$
                                                                    <input type="hidden" name="txtRoomName" value="${room.roomName}" /> </td>
                                                                <td style="color: white"><img src="${room.imgURL}" alt="" height="100" width="100"></td>
                                                                </c:forEach>
                                                        </tr>
                                                    </c:if>

                                                    <!--gold room-->
                                                    <c:if test="${not empty GOLDLIST}">
                                                        <c:if test="${RANK eq 2}">
                                                            <tr>
                                                                <c:forEach var="room" items="${GOLDLIST}">
                                                                    <td style="color: white"><input type="radio" name="rdo" value="${room.roomId}" /></td>
                                                                    <td style="color: white">${room.roomName}<br/>${room.description}<br/>Price: ${room.price}$</td>
                                                                    <td style="color: white"><img src="${room.imgURL}" alt="" height="100" width="100"></td>
                                                                    </c:forEach>
                                                            </tr>
                                                        </c:if>
                                                    </c:if>

                                                    <c:if test="${RANK eq 1}">
                                                        <c:if test="${not empty ROOMLIST}">
                                                            <tr>
                                                                <td></td>
                                                                <td><input type="submit" value="Book" name="btAction" class="btn btn-inverse"/></td>
                                                                <td>
                                                                    <input type="reset" value="Cancel" class="btn btn-inverse"/> </td>
                                                            </tr>
                                                        </c:if>
                                                    </c:if>

                                                    <c:if test="${RANK eq 2}">
                                                        <c:if test="${not empty ROOMLIST}">
                                                            <c:if test="${not empty GOLDLIST}">
                                                                <tr>
                                                                    <td></td>
                                                                    <td></td>
                                                                    <td><input type="submit" value="Book" name="btAction" class="btn btn-inverse"/>
                                                                        <input type="reset" value="Cancel" class="btn btn-inverse"/> </td>
                                                                </tr>
                                                            </c:if>
                                                        </c:if>
                                                    </c:if>
                                                </table>

                                                <c:if test="${not empty MESSAGE1}">
                                                    <span style="color: red">${MESSAGE1}</span>
                                                </c:if>
                                            </c:if>
                                        </c:if>

                                        <!--book phong xong-->
                                        <c:if test="${not empty MESSAGE2}">
                                            <span style="color: red">${MESSAGE2}</span>
                                        </c:if>
                                    </c:if>
                                </c:if>
                            </form>
                        </c:if>
                    </c:if>
                </div>
                <div class="span2"></div>
            </div>
        </div>
        <div class="bottombar">
            <div class="bottom-inner">
                <div class="container">
                    <jsp:include page="footer.jsp" flush="" />
                </div>
            </div>
        </div>
    </body>
</html>

